package com.tedu.api;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.junit.Test;

import java.util.Locale;

public class HomeWork {
    @Test
    public void Main1(){
        String s="HelloJava";
        System.out.println(s.length());
    }
    @Test
    public void Main2(){
        String str="HelloJava";
        int index=str.indexOf('o');
        System.out.println("字符o的位置："+index);
    }
    @Test
    public void Main3(){
        String str="HelloJava";
        int index=str.indexOf('o',5);
        System.out.println("下标为5处开始第一次出现以o的位置:"+index);
    }
    @Test
    public void Main4(){
        String str="HelloJava";
        String hello=str.substring(0,5);
        System.out.println("截取的字符串："+hello);
    }
    @Test
    public void Main5(){
        String str="HelloJava";
        String java=str.substring(5,9);
        System.out.println("截取的字符串："+java);
    }
    @Test
    public void Main6() {
       String s = " Hello ";
        s = s.trim();
        System.out.println(s);
    }
    @Test
    public void Main7(){
        String s="HelloJava";
        char c=s.charAt(5);
        System.out.println(c);
    }
    @Test
    public void Main8(){
        String s="HelloJava";
        String lowerCase=s.toLowerCase();
        String upperCase=lowerCase.toUpperCase();
        System.out.println(lowerCase);
        System.out.println(upperCase);
    }
}
